package com.restaurant.application.indexes.bookingsetlist.mysql;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import com.nebutown.generation.basictype.UID;

import java.util.List;

public class BookingSetListBean implements PickableBean {

    public static final String FN_RECORDID = "recordId";
    public static final String FN_BOOKINGSET = "bookingSet";
    public static final String FN_ID = "id";
    public static final String FN_DATES = "dates";
    public static final String FN_TIMES = "times";
    public static final String FN_SERVICE = "service";
    public static final String FN_CREATETIME = "createTime";
    public static final String FN_MODIFYTIME = "modifyTime";
    public static final String FN_SHOP = "shop";
    public static final String FN_SHOPID = "shopId";
    public static final String FN_SHOPNAME = "shopName";

    public static final List<String> FIELD_NAMES = Lists.newArrayList(
            FN_RECORDID,
            FN_BOOKINGSET,
            FN_ID,
            FN_DATES,
            FN_TIMES,
            FN_SERVICE,
            FN_CREATETIME,
            FN_MODIFYTIME,
            FN_SHOP,
            FN_SHOPID,
            FN_SHOPNAME);
    
    private Long recordId;
    private UID bookingSet;
    private String id;
    private String dates;
    private String times;
    private String service;
    private Long createTime;
    private Long modifyTime;
    private UID shop;
    private String shopId;
    private String shopName;

    public BookingSetListBean(Long recordId, UID bookingSet, String id, String dates, String times, String service, Long createTime, Long modifyTime, UID shop, String shopId, String shopName) {
        setRecordId(recordId);
        setBookingSet(bookingSet);
        setId(id);
        setDates(dates);
        setTimes(times);
        setService(service);
        setCreateTime(createTime);
        setModifyTime(modifyTime);
        setShop(shop);
        setShopId(shopId);
        setShopName(shopName);
    }

    public BookingSetListBean() {
    }

    public BookingSetListBean duplicate() {
        BookingSetListBean result = new BookingSetListBean();
        result.recordId = this.recordId;
        result.bookingSet = this.bookingSet;
        result.id = this.id;
        result.dates = this.dates;
        result.times = this.times;
        result.service = this.service;
        result.createTime = this.createTime;
        result.modifyTime = this.modifyTime;
        result.shop = this.shop;
        result.shopId = this.shopId;
        result.shopName = this.shopName;
        return result;
    }

    @Override
    public String toString() {
        return Convert.toJson(this);
    }

    public Long getRecordId() {
        return recordId;
    }

    public void setRecordId(Long value) {
        this.recordId = value;
    }

    public BookingSetListBean withRecordId(Long value) {
        setRecordId(value);
        return this;
    }

    public BookingSetListBean withRecordId(Long value, Long defaultValue) {
        setRecordId(value == null ? defaultValue : value);
        return this;
    }

    public UID getBookingSet() {
        return bookingSet;
    }

    public void setBookingSet(UID value) {
        this.bookingSet = value;
    }

    public BookingSetListBean withBookingSet(UID value) {
        setBookingSet(value);
        return this;
    }

    public BookingSetListBean withBookingSet(UID value, UID defaultValue) {
        setBookingSet(value == null ? defaultValue : value);
        return this;
    }

    public String getId() {
        return id;
    }

    public void setId(String value) {
        this.id = value;
    }

    public BookingSetListBean withId(String value) {
        setId(value);
        return this;
    }

    public BookingSetListBean withId(String value, String defaultValue) {
        setId(value == null ? defaultValue : value);
        return this;
    }

    public String getDates() {
        return dates;
    }

    public void setDates(String value) {
        this.dates = value;
    }

    public BookingSetListBean withDates(String value) {
        setDates(value);
        return this;
    }

    public BookingSetListBean withDates(String value, String defaultValue) {
        setDates(value == null ? defaultValue : value);
        return this;
    }
    
    public String getTimes() {
        return times;
    }

    public void setTimes(String value) {
        this.times = value;
    }

    public BookingSetListBean withTimes(String value) {
        setTimes(value);
        return this;
    }

    public BookingSetListBean withTimes(String value, String defaultValue) {
        setTimes(value == null ? defaultValue : value);
        return this;
    }

    public String getService() {
        return service;
    }

    public void setService(String value) {
        this.service = value;
    }

    public BookingSetListBean withService(String value) {
        setService(value);
        return this;
    }

    public BookingSetListBean withService(String value, String defaultValue) {
        setService(value == null ? defaultValue : value);
        return this;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long value) {
        this.createTime = value;
    }

    public BookingSetListBean withCreateTime(Long value) {
        setCreateTime(value);
        return this;
    }

    public BookingSetListBean withCreateTime(Long value, Long defaultValue) {
        setCreateTime(value == null ? defaultValue : value);
        return this;
    }

    public Long getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Long value) {
        this.modifyTime = value;
    }

    public BookingSetListBean withModifyTime(Long value) {
        setModifyTime(value);
        return this;
    }

    public BookingSetListBean withModifyTime(Long value, Long defaultValue) {
        setModifyTime(value == null ? defaultValue : value);
        return this;
    }

    public UID getShop() {
        return shop;
    }

    public void setShop(UID value) {
        this.shop = value;
    }

    public BookingSetListBean withShop(UID value) {
        setShop(value);
        return this;
    }

    public BookingSetListBean withShop(UID value, UID defaultValue) {
        setShop(value == null ? defaultValue : value);
        return this;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String value) {
        this.shopId = value;
    }

    public BookingSetListBean withShopId(String value) {
        setShopId(value);
        return this;
    }

    public BookingSetListBean withShopId(String value, String defaultValue) {
        setShopId(value == null ? defaultValue : value);
        return this;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String value) {
        this.shopName = value;
    }

    public BookingSetListBean withShopName(String value) {
        setShopName(value);
        return this;
    }

    public BookingSetListBean withShopName(String value, String defaultValue) {
        setShopName(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        switch (name) {
            case "recordId":
                return getRecordId();
            case "bookingSet":
                return getBookingSet();
            case "id":
                return getId();
            case "dates":
                return getDates();
            case "times":
                return getTimes();
            case "service":
                return getService();
            case "createTime":
                return getCreateTime();
            case "modifyTime":
                return getModifyTime();
            case "shop":
                return getShop();
            case "shopId":
                return getShopId();
            case "shopName":
                return getShopName();
        }
        return null;
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    @Override
    public int hashCode() {
        return signature().hashCode();
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof BookingSetListBean)) return false;
        return signature().equals(((BookingSetListBean) o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean BookingSetListBean has no signature defined, no hash code or equals possible.");
    }
}
